<template>
	<view>
		<remind-carinfo :dataBean="carInfo"></remind-carinfo>

		<view class="boxContrainer">
			<view class="titlBox">
				<text class="title">年检信息</text>
				<text
					style="line-height: 80rpx; color: #E93131;" v-if="detailInfo.days>0">剩余{{detailInfo.days}}天到期</text>
			</view>

			<view v-if="detailInfo.id" class="contentBox">
				<view class="text-line">
					<text class="text-name">本次年检时间:</text>
					<text class="text-value">{{detailInfo.thisTimeInspectionTime|filterNull}}</text>
				</view>

				<view class="text-line">
					<text class="text-name">下次年检时间:</text>
					<text class="text-value">{{detailInfo.nextInspectionTime|filterNull}}</text>
				</view>

				<view class="text-line">
					<text class="text-name">年检费用:</text>
					<text class="text-value">{{detailInfo.inspectionAmount|filterNull}}</text>
				</view>

				<view class="text-line">
					<text class="text-name">年检代理人:</text>
					<text class="text-value">{{detailInfo.inspectionAgent|filterNull}}</text>
				</view>
			</view>

			<view v-else class="nodata">
				<image src="/car/static/no_qx.png" mode=""></image>
				<text>暂无年检</text>
			</view>


			<view v-if="false">
				<u-line color="#efefef" dashed v-if="dataBean.insuranceButton">
				</u-line>

				<view class="btn-detail" v-if="dataBean.insuranceButton" @click="add()">
					年检
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import remindCarinfo from '@/components/remindCarInfo/remind-carinfo.vue';
	import settings from '@/settings.js'
	import {
		inspection
	} from '@/api/car-api.js'
	export default {
		components: {
			remindCarinfo,
		},
		data() {
			return {
				carInfo: {},
				detailInfo: {},
				imgs1:[]
			}
		},
		onLoad(op) {
			this.carInfo = op;
			this.getData();
		},
		methods: {

			getData() {
				inspection(this.carInfo.id).then(res => {
					if(res.data.urlList) {
						res.data.urlList.forEach(item=>{
							this.imgs1.push(settings.baseImageUrl+item);
						})
					}
					this.detailInfo = res.data;
				})
			},

			//新增年检
			add() {
				
			},

		}
	}
</script>

<style lang="scss" scoped>
	.btn-detail {
		width: 180rpx;
		height: 60rpx;
		border-radius: 50rpx;
		color: white;
		text-align: center;
		background-color: $blue15;
		font-size: 26rpx;
		line-height: 60rpx;
		align-self: flex-end;
		margin: 10rpx 20rpx 10rpx;
	}
</style>
